/*
 Navicat Premium Data Transfer

 Source Server         : 本地mysql
 Source Server Type    : MySQL
 Source Server Version : 50619
 Source Host           : localhost
 Source Database       : huolala

 Target Server Type    : MySQL
 Target Server Version : 50619
 File Encoding         : utf-8

 Date: 05/05/2018 01:20:09 AM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `carType`
-- ----------------------------
DROP TABLE IF EXISTS `carType`;
CREATE TABLE `carType` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `image` varchar(50) DEFAULT NULL,
  `price` double DEFAULT NULL,
  `perPrice` double DEFAULT NULL,
  `zaizhong` varchar(50) DEFAULT NULL,
  `size` varchar(50) DEFAULT NULL,
  `tiji` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `carType`
-- ----------------------------
BEGIN;
INSERT INTO `carType` VALUES ('1', '小面包车', 'images/freight_minibus_small_v2.png', '30', '3', '500公斤', '1.8*1.3*1.1', '2.6方'), ('2', '中面包车', 'images/minibus_big_v2.png', '45', '4', '1吨', '2.7*1.4*1.2', '4.5方'), ('3', '小货车', 'images/van_small_v2.png', '65', '4', '1.5吨', '2.7*1.6*1.7', '7.3方'), ('4', '中货车', 'images/van_big_v2.png', '100', '5', '1.8吨', '4.2*1.8*1.8', '13.6方');
COMMIT;

-- ----------------------------
--  Table structure for `driver`
-- ----------------------------
DROP TABLE IF EXISTS `driver`;
CREATE TABLE `driver` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mobile` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `cartype_id` int(11) DEFAULT NULL,
  `carNo` varchar(50) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cartype_id` (`cartype_id`),
  CONSTRAINT `driver_ibfk_1` FOREIGN KEY (`cartype_id`) REFERENCES `carType` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `driver`
-- ----------------------------
BEGIN;
INSERT INTO `driver` VALUES ('1', '138231231345', '李四', '1', '冀D 051CS', '五菱宏光', '123456'), ('2', '138231231346', '王五', '3', '冀D 051CD', '五菱宏光001', '123456'), ('3', '12345678908', '王五', '4', '冀D 051CE', '五菱宏光', '123456'), ('4', '120', '你好啊', '3', '冀D 051AB', '五菱宏光', '120');
COMMIT;

-- ----------------------------
--  Table structure for `orders`
-- ----------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `orderDate` datetime DEFAULT NULL,
  `start` varchar(100) DEFAULT NULL,
  `dest` varchar(100) DEFAULT NULL,
  `extra` varchar(100) DEFAULT NULL,
  `remark` varchar(500) DEFAULT NULL,
  `cartype_id` int(11) DEFAULT NULL,
  `distance` double DEFAULT NULL,
  `orderPrice` double DEFAULT NULL,
  `actualPrice` double DEFAULT NULL,
  `driver_id` int(11) DEFAULT NULL,
  `recieveDate` datetime DEFAULT NULL,
  `state` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `cartype_id` (`cartype_id`),
  KEY `driver_id` (`driver_id`),
  CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`cartype_id`) REFERENCES `carType` (`id`),
  CONSTRAINT `orders_ibfk_3` FOREIGN KEY (`driver_id`) REFERENCES `driver` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `orders`
-- ----------------------------
BEGIN;
INSERT INTO `orders` VALUES ('1', '2', '2018-05-04 22:44:05', '河北工程大学', '广厦小区', '需要搬运', '无', '1', null, null, null, null, null, '0'), ('2', '2', '2018-05-04 23:32:54', '邯郸市丛台区广厦小区', '邯郸市邯山区河北工程大学', '无', '无', '2', null, null, null, null, null, '0'), ('3', '2', '2018-05-04 23:37:21', '邯郸市丛台区广厦小区', '邯郸市邯山区河北工程大学', '无', '无', '2', null, null, null, null, null, '0'), ('4', '2', '2018-05-04 23:37:46', '邯郸市丛台区广厦小区', '邯郸市邯山区河北工程大学', '无', '无', '2', null, null, null, null, null, '1'), ('5', '2', '2018-05-04 23:47:49', '邯郸市丛台区广厦小区', '邯郸市邯山区北大青鸟(翱翔校区)', '无', '无', '2', null, null, null, null, null, '0'), ('6', '2', '2018-05-05 00:04:37', '邯郸市丛台区广厦小区', '邯郸市邯山区北大青鸟(翱翔校区)', '无', '无没有', '2', null, null, null, null, null, '0'), ('7', '2', '2018-05-05 00:17:20', '邯郸市丛台区广厦小区', '邯郸市邯山区邯郸市一中新校区', '搬运', '没有', '2', null, null, null, null, null, '0'), ('8', '2', '2018-05-05 00:23:08', '邯郸市丛台区广厦小区', '邯郸市峰峰矿区元宝山', '没有', '没有', '2', '54', '241', null, '1', null, '2'), ('9', '2', '2018-05-05 00:29:33', '广厦小区', '邯郸市峰峰矿区元宝山', '每', '每', '2', null, null, null, null, null, '0'), ('10', '2', '2018-05-05 01:10:06', '邯郸市丛台区龙湖公园', '邯郸市峰峰矿区元宝山', '无', '无', '2', '46.5', '211', null, '2', '2018-05-05 01:10:33', '2'), ('11', '4', '2018-05-05 01:14:54', '邯郸市丛台区龙湖公园', '邯郸市峰峰矿区元宝山', '需要搬运工', '无', '4', '46.5', '307.5', null, '4', '2018-05-05 01:15:20', '2');
COMMIT;

-- ----------------------------
--  Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mobile` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `password` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `users`
-- ----------------------------
BEGIN;
INSERT INTO `users` VALUES ('1', '15097679443', 'maomao', '123456'), ('2', '15097679444', '郑毛强', '123456'), ('3', '1234567890', 'wo hen mei', '123456'), ('4', '100', '马冬梅', '111');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
